From 78ba8557f7e021dce8ec1a846399fd99553e1c62 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Thu, 1 Aug 2024 17:24:35 -0500 Subject: [PATCH] Move table rows into their own %def --- src/pgwui_common/templates/auth_base.mak | 18 +++++------ src/pgwui_common/templates/db_base.mak | 41 ++++++++++++------------ 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/pgwui_common/templates/auth_base.mak b/src/pgwui_common/templates/auth_base.mak index 098b54a..927c4b2 100644 --- a/src/pgwui_common/templates/auth_base.mak +++ b/src/pgwui_common/templates/auth_base.mak @@ -136,6 +136,14 @@ % endif +<%def name="table_rows(tab_index)"> + <% + self.user_row(tab_index, havecreds, user) + self.password_row(tab_index, havecreds) + caller.body(tab_index) + %> + + <%def name="main_form(tab_index)">
@@ -149,15 +157,7 @@
- <% - if hasattr(caller, 'database_row'): - caller.database_row(tab_index) - self.user_row(tab_index, havecreds, user) - self.password_row(tab_index, havecreds) - - caller.body(tab_index) - - %> + <%self:table_rows tab_index="${tab_index}" args="tab_index"/>

diff --git a/src/pgwui_common/templates/db_base.mak b/src/pgwui_common/templates/db_base.mak index 80b2775..694b6ef 100644 --- a/src/pgwui_common/templates/db_base.mak +++ b/src/pgwui_common/templates/db_base.mak @@ -64,26 +64,27 @@ table. -<%def name="main_form(tab_index)"> - <%parent:main_form tab_index="${tab_index}" args="tab_index"> - <%def name="database_row(tab_index)"> - - - - - - - - - <% tab_index.inc() %> - +<%def name="database_row(tab_index)"> + + + + + + + + + <% tab_index.inc() %> + +<%def name="table_rows(tab_index)"> + ${self.database_row(tab_index)} + <%parent:table_rows tab_index="${tab_index}" args="tab_index"> <% caller.body(tab_index) %> - + -- 2.34.1